          
          
         
            //var originalWidth = consultWidth = window.innerWidth;
            //var linkJumpCount = 16;
            var linkHref;
            var beginningDelay = null;
            var animateDelayCount = 4000;
            var watchBrowse = null;
            var watching = null;
            //first ele add class
            function fstAddClass(){
                for(var c = 0;c < $('.addFst').length;c++){
                    $('.addFst:eq(' + c + ')>*:first-child').addClass('active');
                }
            }
            function countDown(){
                linkJumpCount -= 1;
               
                //linkJumpCount=0时，跳转页面
                if(linkJumpCount <= 0){
                    location.href = linkHref;
                }

                //每秒执行一次,showTime()
                setTimeout("countDown()",100);
            }
            //禁止滚动
            function onMouseScroll(event) {
                    event.preventDefault();
                    var wheel = e.originalEvent.wheelDelta || -e.originalEvent.detail;
                    var delta = Math.max(-1, Math.min(1, wheel) );
                    if(delta < 0){//向下滚动
                        scrollDown = true;
                    }else{//向上滚动
                        scrollDown = false;
                    }
            }
            //内容高度是否小于屏幕高度
            function checkContnHeight(){
                if($('.container')[0].offsetHeight < window.innerHeight){
                    $('.container').addClass('fillAll');
                }
            }
            //前进后退页面处于顶部
            function beginningAtTop(){
                setTimeout(function(){
                    document.documentElement.scrollTop = document.body.scrollTop = 0;
                    backTop = true;
                },50)
            }

            //判断是否为移动设备
            function browserRedirect(){
                var sUserAgent = navigator.userAgent.toLowerCase();
                var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
                var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
                var bIsMidp = sUserAgent.match(/midp/i) == "midp";
                var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
                var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
                var bIsAndroid = sUserAgent.match(/android/i) == "android";
                var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
                var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
                if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
                    $('body').addClass('mobileDevice');
                    return true;
                }else{
                    return false;
                }
            }

            var backTop = false;
            var disappear = null;
            
            $(document).ready(function(){
                    browserRedirect(); 
                    fstAddClass();
                    setTimeout(checkContnHeight,10);
                    setTimeout(function(){
                        $('header .menu .menuBtn').addClass('active');
                    },10)
                    beginningAtTop()
                   
                    watching = setInterval(function(){
                        var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
                        if(window.innerWidth > 1024){
                            if(scrollTop + $('header .menu')[0].offsetHeight > window.innerHeight){
                                $('header .menu nav').removeClass('active');
                            }else{
                                $('header .menu nav').addClass('active');
                                $('header .menu nav').removeClass('clicked');
                            }
                        }
                        
                    },10)
                    $('header .menu .menuBtn').click(function(){
                        if($('header .menu nav')[0].className.indexOf('clicked') >= 0){
                            $('header .menu nav').removeClass('clicked');
                        }else{
                            $('header .menu nav').addClass('clicked');
                        }
                    })

                    $('header .menu nav ul li').mouseenter(function(){
                        //console.log('enter');
                        $('header .menu nav input').removeClass('active');
                        $(this).addClass('show');
                        if($(this).find('.inner').length){
                            var innerH = $(this).find('.inner')[0].offsetHeight;
                            $(this).find('.sonMenu').height(innerH);
                        }
                    })
                    $('header .menu nav ul li').mouseleave(function(){
                        var This = $(this);
                        
                        if(This.next().length){
                            disappear = setTimeout(function(){
                                This.removeClass('show');
                                This.find('.sonMenu').height(0);
                            },100)
                        }else{
                            This.removeClass('show');
                        }
                        $('header .menu nav ul li>a').removeClass('once');
                    })
                    $('header .menu nav ul li>a').click(function(e){
                        if($('.mobileDevice').length && $(this).next().length){
                            e = e || window.event;
                            e.cancelBubble = true;
                            e.stopPropagation();
                            if(e.preventDefault){ // w3c
                                e.preventDefault();
                            } else { // ie
                                e.returnValue = false;
                            }
                            //console.log('mobile');
                        }
                        if($(this)[0].className.indexOf('once') >= 0){
                            window.location.href = $(this).attr('href');
                        }else{
                            $(this).addClass('once');
                        }

                    })
                    $('header .menu nav ul li .sonMenu').mouseenter(function(){
                        if(disappear){
                            clearTimeout(disappear);
                            disappear = null;
                        }
                    })
                    $('header .menu nav ul li .sonMenu').mouseleave(function(){
                        if($(this).parent()[0].className.indexOf('show') >= 0){
                            $(this).parent().removeClass('show');
                            $(this).height(0);
                        }
                    })

                    var nowHref = window.location.href;
                    for(var c = 0;c < $('header .menu nav ul li>a');c++){
                        if(nowHref.indexOf($('header .menu nav ul li>a').eq(c).attr('href')) >= 0){
                            $('header .menu nav ul li>a').eq(c).parent().addClass('active');
                        }
                    }

                    $('header .menu nav .search').click(function(){
                        if(window.innerWidth <= 1024){
                            if($('header .menu nav input')[0].className.indexOf('active') >= 0){
                                
                            }else{
                                $('header .menu nav input').addClass('active');
                            }
                            
                        }else{
                            $('header .searchBox').addClass('active');
                        }
                        
                    })

                    $('header .searchBox .close').click(function(){
                        $('header .searchBox').removeClass('active');
                    })

                    

                    /*$('a').click(function(e){
                        
                            linkHref = $(this).attr('href');
                            e = e || window.event;
                            e.cancelBubble = true;
                            e.stopPropagation();
                            if(e.preventDefault){ // w3c
                                e.preventDefault();
                            } else { // ie
                                e.returnValue = false;
                            }
                            countDown();
                            $('.leaving').addClass('jump');
                            $('.container').addClass('jump');
                    })*/
                    
            })

            /*function load (){ 
                document.addEventListener('touchstart',touch, {passive:false}); 
                document.addEventListener('touchmove',touch, {passive:false}); 
                document.addEventListener('touchend',touch, {passive:false}); 
                function touch (event){ 
                    var event = event || window.event; 
                    switch(event.type){ 
                        case "touchstart": 
                            console.log("Touch started (" + event.touches[0].clientX + "," + event.touches[0].clientY + ")"); 
                            break; 
                        case "touchend": 
                            console.log("<br>Touch end (" + event.changedTouches[0].clientX + "," + event.changedTouches[0].clientY + ")"); 
                            break; 
                        case "touchmove": 
                            event.preventDefault(); 
                            console.log("<br>Touch moved (" + event.touches[0].clientX + "," + event.touches[0].clientY + ")"); 
                            break; 
                    }
                } 
            } 
            window.addEventListener('load',load, false);*/
            //$(document).on('mousewheel DOMMouseScroll', onMouseScroll);
            

        